<!-- 修改后的App.vue -->
<template>
  <div class="login-bg flex-1">
    <div class="container ">
      <transition name="fade-transform" mode="out-in">
        <component 
          :is="isRegister ? RegisterForm : LoginForm"
          @switch-form="isRegister = !isRegister"
          class="form-wrapper"
        />
      </transition>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import LoginForm from './components/LoginForm.vue'
import RegisterForm from './components/RegisterForm.vue'

const isRegister = ref(false)
</script>

<style >
.login-bg {
  position: fixed;
  width: 100%;
  height: 100%;
  /* background: url('https://source.unsplash.com/random/1920x1080/?nature') center/cover;
  filter: saturate(1.2); */
  background-color: #fff;
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  /* background: rgba(0, 0, 0, 0.5); */
  backdrop-filter: blur(8px);
  width: 100%;
}

.form-wrapper {
  transform: translateY(-10%);
}

/* 过渡动画 */
.fade-transform-leave-active,
.fade-transform-enter-active {
  transition: all 0.3s ease;
}

.fade-transform-enter-from {
  opacity: 0;
  transform: translateX(30px);
}

.fade-transform-leave-to {
  opacity: 0;
  transform: translateX(-30px);
}
</style>